home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / what300.zip / WHATDOC.TXT < prev    next >
Text File  |  1991-04-30  |  31KB  |  764 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.      WHAT?format
  12.  
  13.  
  14.      A file format recognition utility
  15.      for IBM PCs and compatibles
  16.  
  17.  
  18.      Version 30.0
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.      Boots & Pepper
  62.  
  63.  
  64.  
  65.  
  66.      WHAT?format is copyright (c) Boots & Pepper 1989-91.
  67.  
  68.      It may be freely distributed provided no changes are made to WHAT.EXE
  69.      or the WHATDOC files. It may not be bundled or distributed with
  70.      commercial software without the author's permission.
  71.  
  72.      WHAT is shareware. If you find it useful, please register your copy
  73.      by sending $15 (NOK 100) to:
  74.  
  75.           Boots & Pepper, Pilestredet 97, N-0358 Oslo, Norway.
  76.           Giro: 1730.18.96921
  77.  
  78.      Registration entitles you to a free copy of the next public release
  79.      of the program. Other feedback   bug reports, information about
  80.      formats not currently supported, whatever   may be sent to the
  81.      address above or to:
  82.  
  83.           CompuServe: 76057,246 (Steve Pepper)
  84.           email: pepper@falch.no (from medio May 1991)
  85.  
  86.      Boots & Pepper is Steve Pepper and Dag (Boots) Hasvold. We run
  87.      Computertext BBS   a bulletin board specialising in aspects of
  88.      computing in the printing industry (DTP, PostScript, SGML, text
  89.      conversion etc.)   on +47-2-162650 (2400-8N1).
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.      WHAT?format 30.0
  97.  
  98.      A file format recognition utility
  99.      for IBM PCs and compatibles
  100.  
  101.  
  102.      Introduction   WHAT?format started life as a simple utility whose
  103.                     purpose was to distinguish between text files created
  104.                     by WordStar and WordPerfect. It was originally written
  105.                     for people working in a typesetting house which
  106.                     received a lot of raw text on floppy disks   all too
  107.                     often without any information regarding the system
  108.                     that had created the files.
  109.  
  110.                     As time has gone by, the program's capabilities have
  111.                     been extended so that the present version can
  112.                     distinguish between the native formats of thirty of
  113.                     the most common word processors. In many cases it will
  114.                     also distinguish between files created by different
  115.                     versions of the same program, e.g. WordPerfect 4.x
  116.                     (4.2 and earlier), 5.0, 5.1, etc.
  117.  
  118.                     In addition to native word processor formats, version
  119.                     30.0 also supports a number of text interchange
  120.                     formats (e.g. Document Content Architecture and Rich
  121.                     Text Format), various text-only formats (ASCII, DOS,
  122.                     EBCDIC, etc.), and a few print-formatted/page
  123.                     description formats (PostScript, PCL, etc.).
  124.  
  125.                     Although it is primarily concerned with text files,
  126.                     WHAT will also recognise an assortment of other common
  127.                     data formats stemming from database, spreadsheet,
  128.                     graphics and other applications. (A complete list of
  129.                     supported formats is given in Appendix A.) Other
  130.                     features include the ability to create straight hex
  131.                     dumps and character set maps. These are described in
  132.                     detail below under Options.
  133.  
  134.      Usage          To use WHAT in its basic mode as a format recognition
  135.                     utility, simply type WHAT at the DOS prompt, followed
  136.                     by the name of the file to be analysed. The file name
  137.                     may include optional drive and path specifications, as
  138.                     well as standard DOS wildcards:
  139.  
  140.                     C:\>WHAT myfile.doc
  141.                     (analyse myfile.doc in current directory)
  142.  
  143.                     C:\>WHAT a:*.*
  144.                     (analyse all files on disk in drive A:)
  145.  
  146.                     WHAT takes each file matching the file specification
  147.                     and writes its name and size on the screen, analyses
  148.                     it and reports the result. Unrecognized files are
  149.                     reported as being of UNKNOWN FORMAT. The file name and
  150.                     size are written to DOS' CON device; the result is
  151.  
  152.      WHATDOC 30.0                                                        3
  153.  
  154.  
  155.  
  156.                     written to the standard output device (normally the
  157.                     console), making it possible to send the result to a
  158.                     file using the usual DOS redirection techniques.
  159.  
  160.      The DOS        Each major format supported by WHAT has its own format
  161.      Errorlevel     code that distinguishes it from all other major
  162.                     formats. For example, WordPerfect has the format code
  163.                     32. Upon exiting to DOS, WHAT sets the DOS errorlevel
  164.                     variable to the format code corresponding to the
  165.                     result it arrived at for the last of the files that
  166.                     were analysed. Thus, if the last file analysed by WHAT
  167.                     turns out to be in WordPerfect format, the DOS
  168.                     errorlevel will be set to 32.
  169.  
  170.                     This feature can be used in batch files, both to
  171.                     automate various kinds of file processing (conversion,
  172.                     cataloging, etc.) and as a way of ensuring that files
  173.                     of the wrong type do not get sent through a particular
  174.                     process. An example of such a batch file, WPCONV.BAT,
  175.                     is given in Appendix B. (See the description of the /E
  176.                     and /F switches below for more information on using
  177.                     the errorlevel feature.)
  178.  
  179.                     NOTE: WHAT's format codes change from version to
  180.                     version, as new formats are added to the program, so
  181.                     be sure to update your batch files when you receive a
  182.                     new version of WHAT.
  183.  
  184.      The %WHAT%     Where possible, WHAT attempts to distinguish between
  185.      variable       different versions of the same file format. Thus a
  186.                     WordPerfect file will be identified as version 4.x
  187.                     (meaning 4.2 or older), 5.0, 5.1 or whatever. In the
  188.                     case of bitmap files, WHAT will often report the size
  189.                     of the image, and possibly also the number of colours.
  190.                     With a file in MacBinary format, WHAT reports the
  191.                     file's TYPE and CREATOR. It is possible to test for
  192.                     all these kinds of information using the %WHAT%
  193.                     environment variable.
  194.  
  195.                     Before exiting to DOS, WHAT looks to see if the envir-
  196.                     onment variable %WHAT% exists. If it does, WHAT sets
  197.                     it to the exact result shown on the screen for the
  198.                     last file analysed, e.g. "WordPerfect 5.1" or "PCX IV
  199.                     640x480x256". (Note that this string can be up to 19
  200.                     characters in length. An error is reported if there is
  201.                     not enough room in the environment.) Appendix B gives
  202.                     an example (SORTPICS.BAT) of a batch file that uses
  203.                     the %WHAT% variable to sort graphics files by format.
  204.  
  205.      Options        NOTE: All options can be used in either upper or lower
  206.                     case, and may be preceded by either a slash or a
  207.                     hyphen. Those used in conjunction with file names may
  208.                     appear either before or after the file specification.
  209.  
  210.  
  211.  
  212.  
  213.      WHATDOC 30.0                                                        4
  214.  
  215.  
  216.  
  217.      Character set  Usage:  WHAT <filespec> /C [ >filename ]
  218.  
  219.                     Creates an on-screen map of all characters appearing
  220.                     in the first file that matches <filespec>. The user is
  221.                     then given the option of writing more detailed
  222.                     information (including the offset and context of the
  223.                     first occurrence of each character) to the standard
  224.                     output. If redirection has been specified on the
  225.                     command line, the result will be a text file suitable
  226.                     for viewing with Vern Buerg's LIST.
  227.  
  228.                     The character set option is particularly useful with
  229.                     plain text files that do not use one of the standard
  230.                     character sets. Note that /C uses the underline
  231.                     attribute in order to create a 16x16 character set
  232.                     matrix on the screen. This gives better results on
  233.                     monochrome than on colour monitors.
  234.  
  235.      Errorlevel     Usage:  WHAT /E [ >filename ]
  236.  
  237.                     Generates a list of format codes in a form which can
  238.                     easily be modified to create batch files like those
  239.                     shown in Appendix B. The output can be sent to a file
  240.                     using DOS redirection.
  241.  
  242.      Format code    Usage:  WHAT /F<format>
  243.  
  244.                     Presents a list of all supported major formats which
  245.                     contain the substring <format>, together with the
  246.                     corresponding format code. The operation is case
  247.                     insensitive. For example:
  248.  
  249.                          WHAT /fperfect
  250.  
  251.                     will give the following result:  
  252.  
  253.                          32 WordPerfect
  254.                          46 DataPerfect
  255.                          56 PlanPerfect
  256.                          62 DrawPerfect
  257.  
  258.      Hex dump       Usage:  WHAT <filespec> /X [ >filename ]
  259.  
  260.                     Creates a hex dump of the first file that matches
  261.                     <filespec>. The output contains only hex values   no
  262.                     file offsets or character equivalents. The main
  263.                     purpose of this switch is to simplify the analysis of
  264.                     long and complicated formatting instructions
  265.                     contained within a text file. (The resulting file is
  266.                     easy to edit since it only contains hex values.) If
  267.                     you merely want to view the contents of a file in hex
  268.                     format, you will be better off using a file browsing
  269.                     utility like LIST, PC-Tools or Norton Utilities that
  270.                     also displays file offsets and ASCII equivalents.
  271.  
  272.  
  273.  
  274.      WHATDOC 30.0                                                        5
  275.  
  276.  
  277.  
  278.      Help           Usage:  WHAT /H
  279.  
  280.                     Shows WHAT's help screen. The help screen is also
  281.                     shown when WHAT is invoked without any command line
  282.                     parameters.
  283.  
  284.      List formats   Usage:  WHAT /L
  285.  
  286.                     Presents an on-screen list of all file formats
  287.                     supported by the current version of WHAT.
  288.  
  289.      Quiet mode     Usage:  WHAT /Q <filespec>
  290.  
  291.                     Suppresses screen output (for use in batch files).
  292.  
  293.      Redirection    Usage:  WHAT /R <filespec>
  294.  
  295.                     Enables redirection of all three elements of WHAT's
  296.                     screen output (i.e. the file's name, size and
  297.                     format). Normally only the format is written to DOS'
  298.                     standard output.
  299.  
  300.      Commentary     WHAT is not foolproof, nor is it meant to be. It
  301.                     belongs to the venerable family of Q&D-utilities, and
  302.                     its basic philosophy is to be right as often as
  303.                     possible but without spending all day about it. It is
  304.                     not as Quick as it could be, and it is no doubt a
  305.                     good deal Dirtier than it would have been if I'd been
  306.                     a real programmer. That said, it has been tested
  307.                     fairly thoroughly on a number of systems and performs
  308.                     as described in this documentation. No problems have
  309.                     been reported that would consitute a threat to your
  310.                     computer or data, but as always, no responsibility is
  311.                     taken for damage resulting from incorrect or careless
  312.                     use of the program.
  313.  
  314.      How it works   WHAT works by scanning the beginning of a file and
  315.                     looking for specific formatting features that can
  316.                     identify its format. The precise features looked for
  317.                     vary. Some applications   especially newer ones  
  318.                     create files with headers containing an ID-tag, a
  319.                     kind of "thumbprint" consisting of a special sequence
  320.                     of bytes that the application itself uses to
  321.                     determine whether or not the file is in its native
  322.                     format. For example, all files created by WordPerfect
  323.                     5.0 or later (and other WP Corp products) begin with
  324.                     the byte sequence FF 57 50 43 (-1,"WPC"). These kind
  325.                     of files are an easy match, and WHAT will handle them
  326.                     quickly and flawlessly.
  327.  
  328.      Problems       Other programs present greater problems, especially
  329.                     those with a native format closely akin to pure
  330.                     ASCII. PC-Write, for example, produces ASCII files if
  331.                     the document doesn't contain guide line font commands
  332.                     or text with attributes such as bold, underline etc.
  333.                     Such a file will be reported as being ASCII by WHAT.
  334.  
  335.      WHATDOC 30.0                                                        6
  336.  
  337.  
  338.  
  339.                     If on the other hand, the PC-Write document contains
  340.                     a few words that are underlined, the file will
  341.                     resemble an ASCII file interspersed with the odd 17h
  342.                       a "non-ASCII" character. This will probably be
  343.                     enough for WHAT to reach a verdict of PC-Write, but
  344.                     it is not difficult to imagine that the file could
  345.                     have been produced by another program and that the
  346.                     17h means something quite different. In such
  347.                     borderline cases a programming decision has been made
  348.                     based upon the assumed popularity of particular
  349.                     applications. (If you disagree with the decision,
  350.                     don't hesitate to let me know!) When WHAT makes a
  351.                     mistake, it is often in this kind of situation.
  352.  
  353.      More problems  Another example will further illustrate the problems
  354.                     involved in differentiating between word processing
  355.                     systems that use similar formats. I recently down-
  356.                     loaded an ARChive file containing a number of text
  357.                     files from a bulletin board system. These files
  358.                     looked like ASCII when I viewed them with LIST, but
  359.                     WHAT said they were WordPerfect 4.x. In actual fact
  360.                     they turned out to be UNIX-type ASCII files with line
  361.                     endings marked by a single LF instead of the CR/LF
  362.                     pair used under DOS. (The archive file seems to have
  363.                     been put together on an Amiga.) LF (0Ah) is the code
  364.                     used by WordPerfect to represent a hard return (hence
  365.                     WHAT's diagnosis), so the files could equally well
  366.                     have been prepared using WordPerfect (except that
  367.                     they also had hard returns where there should have
  368.                     been soft returns).
  369.  
  370.                     The question here is whether the result reached by
  371.                     WHAT was acceptable. My answer   based mainly upon
  372.                     pragmatic considerations   is yes: Wherever the file
  373.                     might have come from, it is now on a PC (otherwise I
  374.                     wouldn't be using WHAT!), and if it is to be edited
  375.                     on a PC, the best program to use is WordPerfect. Most
  376.                     ASCII editors would complain bitterly about the
  377.                     missing CR at the end of each line; but WordPerfect
  378.                     is over the moon, and it will even allow me to
  379.                     regenerate most of the soft returns (by reading in
  380.                     the file, saving it as DOS text, and reading it in
  381.                     again, this time as DOS text, using the option of
  382.                     converting hard returns in the hyphenation zone to
  383.                     soft returns). So in this case, WordPerfect is the
  384.                     best answer   even though strictly speaking it is the
  385.                     wrong one.
  386.  
  387.      Dirty tricks   If there is one thing that really slows WHAT down it
  388.                     is a lot of files in unsupported formats. A couple of
  389.                     dirty tricks are used to minimise this problem.
  390.                     Firstly, WHAT never reads more than the first 5 Kb of
  391.                     a file, reasoning that if it hasn't made up its mind
  392.                     by then, it probably never will. This could in theory
  393.                     lead to problems. For example, a PC-Write document
  394.                     consisting of 2 3 pages of straight ASCII followed by
  395.  
  396.      WHATDOC 30.0                                                        7
  397.  
  398.  
  399.  
  400.                     a few pages of heavily formatted text will be judged
  401.                     to be ASCII   but you'll be in trouble if you try to
  402.                     import it to, say, WordPerfect as "DOS Text". Such
  403.                     situations occur so rarely in practice, however, that
  404.                     the speed advantages of just looking at the beginning
  405.                     of a document outweigh the potential disadvantages.
  406.  
  407.                     Secondly, WHAT doesn't bother to try to ascertain
  408.                     whether a COM-file really is executable: The present
  409.                     version quite simply ignores files with the extension
  410.                     .COM (except when the only files that match the file
  411.                     specification have this extension, in which case WHAT
  412.                     will attempt to analyse the last one   hopefully
  413.                     unsuccessfully).
  414.  
  415.      ASCII files    The criterion for differentiating between what WHAT
  416.      and DOS files  calls "ASCII text files" and "DOS text files" is
  417.                     whether or not characters from the Extended ASCII set
  418.                     appear in the file. An ASCII file can only contain
  419.                     7-bit characters. This is an important distinction in
  420.                     certain European countries where accented characters
  421.                     may be represented by national versions of the
  422.                     (7-bit) ISO 646 character set, so English-speaking
  423.                     users will just have to live with it! In neither
  424.                     format does WHAT expect to encounter any control
  425.                     characters other than TAB (09h), CR (0Dh), LF (0Ah),
  426.                     FF (0Ch) or a single Control-Z end-of-file marker
  427.                     (1Ah).
  428.  
  429.      Feedback       The biggest problem with a program like WHAT is
  430.                     keeping it up to date. New word processing programs
  431.                     are appearing all the time, and most of them use
  432.                     their own native format. Occasionally the format is
  433.                     described in the documentation that follows the
  434.                     application, but usually that is not the case. Some
  435.                     software publishers are willing to make the details
  436.                     of the format available to developers; others (like
  437.                     Microsoft and IBM) keep them a closely guarded
  438.                     secret.
  439.  
  440.                     Upgrades of existing programs also present problems.
  441.                     As new formatting features are added to the applica-
  442.                     tion, the native format changes in order to accommo-
  443.                     date them. Sometimes these changes amount to no more
  444.                     than the addition of new codes to the old format (as
  445.                     when WordPerfect was upgraded from 4.1 to 4.2). More
  446.                     major revisions, on the other hand, can lead to a
  447.                     complete revamping of the native format (as was the
  448.                     case with WordPerfect 5.0). WHAT has been designed as
  449.                     far as possible to be able to handle new versions of
  450.                     formats that are already supported, but no guarantees
  451.                     are made. (I am fairly certain that WHAT will
  452.                     recognise documents created by version 6.5 of
  453.                     WordPerfect, but what happens with 9.0 documents is
  454.                     anybody's guess!)
  455.  
  456.  
  457.      WHATDOC 30.0                                                        8
  458.  
  459.  
  460.  
  461.                     Keeping abreast of all these changes and additions is
  462.                     no easy matter (I have yet to find a company that
  463.                     runs a mailing list for people interested in this
  464.                     kind of information!). What that means is that WHAT
  465.                     can only be improved and kept up to date with the
  466.                     assistance of its users. So if you find that WHAT
  467.                     makes a mistake when analysing a supported format,
  468.                     experience trouble with the latest version of a
  469.                     particular program, or can provide information on
  470.                     file formats not currently supported by WHAT, please
  471.                     do not hesitate to get in touch. The more example
  472.                     files and technical information you can provide for a
  473.                     particular format the better. Your efforts will be
  474.                     rewarded with an acknowledgement in the next version
  475.                     of WHATDOC and a typeset copy of this one. (The "wish
  476.                     list" for the next version of WHAT includes support
  477.                     for CGM, CUT, DXF, GEM, and PIC graphics, Quattro,
  478.                     PFS, Q&A, PageMaker, and the latest versions of
  479.                     DisplayWrite, Framework and Lotus 1-2-3; more
  480.                     information on Word for Windows and Excel   and
  481.                     whatever else you and I can get our hands on!)
  482.  
  483.      Thanks to...   Dag Hasvold, Aron Gurski, Gisle Hannemyr, Truls
  484.                     Meland, Tor Nordahl, Mike Robertson, Mats Tande and
  485.                     Chris Wolf for suggestions and help.
  486.  
  487.                     Send comments, files and format documentation to
  488.                     Steve Pepper, Pilestredet 97, N-0358 Oslo, Norway
  489.                     (email: pepper@falch.no), or log on to Computertext
  490.                     BBS (2400 8-N-1) +47-2-420825.
  491.  
  492.                     One final thing: Don't bother suggesting that the
  493.                     next version of WHAT ought to be able to recognise
  494.                     non-DOS disk formats unless you are prepared to tell
  495.                     me how to implement such a feature. I know it would
  496.                     be enormously useful, but I am a typographer, not a
  497.                     programmer!
  498.  
  499.                     Steve Pepper
  500.                     Oslo, 19 April 1991
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.      WHATDOC 30.0                                                        9
  519.  
  520.  
  521.  
  522.                     Appendix A
  523.  
  524.                     Text and data formats supported
  525.                     by WHAT?format v. 30.0
  526.  
  527.                     Here is a complete list of all formats supported by
  528.                     version 30.0 of WHAT. Those formats for which extra
  529.                     information is given (other than version number) are
  530.                     shown in bold type. Please support WHAT by helping to
  531.                     make this list more comprehensive!
  532.  
  533.      Word           Ability WP
  534.      processors     Acto WP
  535.                     Am  Professional
  536.                     ASCII text file (09,0A,0C,0D,1A and 20..7E)
  537.                     ASCII even parity
  538.                     Cicero
  539.                     DisplayWrite
  540.                     DOS text file (as ASCII, plus 80..FE)
  541.                     DSI Tekst
  542.                     EBCDIC file
  543.                     Enable WPF
  544.                     Framework
  545.                     Manuscript
  546.                     MASS-11
  547.                     Microsoft Word
  548.                     MicroWord
  549.                     Multimate
  550.                     Notis WP
  551.                     OfficeWriter
  552.                     Ordbehandling
  553.                     Palantir
  554.                     PC-Write
  555.                     Samna Word
  556.                     Sprint
  557.                     Super WP
  558.                     Symphony
  559.                     Ventura Publisher
  560.                     Volkswriter
  561.                     Windows Write
  562.                     Word for Windows
  563.                     WordPerfect
  564.                     WordStar
  565.                     WordStar 2000
  566.                     XPress tagged ASCII
  567.                     XyWrite
  568.  
  569.      Formatted      PostScript   Structuring Conventions version
  570.      text           DCA/RFT (DCA Revisable Form Text)
  571.                     DEC DX
  572.                     HP LaserJet (PCL)
  573.                     IBM DCF-GML (Generalised Markup Language)
  574.                     RTF (Microsoft Rich Text Format
  575.  
  576.      Data bases     Ability
  577.                     DataPerfect
  578.  
  579.      WHATDOC 30.0                                                       10
  580.  
  581.  
  582.  
  583.                     dBASE
  584.                     Enable
  585.                     Reflex
  586.  
  587.      Spreadsheets   Ability
  588.                     DIF
  589.                     Enable
  590.                     Excel
  591.                     Lotus 1-2-3
  592.                     PlanPerfect
  593.                     SuperCalc
  594.                     SYLK (Microsoft Symbolic Link)
  595.  
  596.      Graphics       Ability Am  Metafile
  597.                     DrawPerfect
  598.                     EPSF (Encapsulated PostScript)
  599.                     GIF   resolution and number of colours
  600.                     IFF   resolution for ILBM files
  601.                     IMG   width and height
  602.                     Lotus PIC
  603.                     MacPaint
  604.                     Microsoft Paint   width and height
  605.                     PCX   version, size and number of colours
  606.                     TIFF   version and type (Motorola or Intel)
  607.                     WPG   version and type (bitmap/drawing)
  608.  
  609.      Various        Ability comms
  610.                     ARC archive
  611.                     DOS Code Page font
  612.                     EXE file
  613.                     LZH archive
  614.                     MacBinary   TYPE and CREATOR
  615.                     PostScript outline font
  616.                     StuffIt! archive
  617.                     Windows EXE file
  618.                     Windows font
  619.                     ZIP archive
  620.                     Miscellaneous file types from WordPerfect Corp.
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.      WHATDOC 30.0                                                       11
  641.  
  642.  
  643.  
  644.                     Appendix B
  645.  
  646.                     Example batch files using the DOS
  647.                     errorlevel and %WHAT% variable
  648.  
  649.      SORTPICS.BAT   @echo off
  650.                     rem
  651.      (using the DOS rem SORTPICS.BAT
  652.      errorlevel)    rem
  653.                     rem Sort your pics using WHAT?format!
  654.                     rem
  655.                     rem Change to a directory containing an
  656.                     rem assortment of graphics files and give
  657.                     rem the command:
  658.                     rem
  659.                     rem    for %f in (*.*) do sortpics %f
  660.                     rem
  661.                     rem The files are copied to different
  662.                     rem directories depending on their format
  663.                     rem
  664.                     if not exist %1 goto :end
  665.                     what %1
  666.                     if errorlevel 72 goto :end
  667.                     if errorlevel 71 goto :TIFF
  668.                     if errorlevel 70 goto :PCX
  669.                     if errorlevel 69 goto :end
  670.                     if errorlevel 66 goto :IMG
  671.                     if errorlevel 65 goto :end
  672.                     if errorlevel 64 goto :GIF
  673.                     goto :end
  674.                     :TIFF
  675.                     copy %1 c:\graphics\tiff
  676.                     del %1
  677.                     goto :end
  678.                     :PCX
  679.                     copy %1 c:\graphics\pcx
  680.                     del %1
  681.                     goto :end
  682.                     :IMG
  683.                     copy %1 c:\graphics\img
  684.                     del %1
  685.                     goto :end
  686.                     :GIF
  687.                     copy %1 c:\graphics\gif
  688.                     del %1
  689.                     goto :end
  690.                     :end
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.      WHATDOC 30.0                                                       12
  702.  
  703.  
  704.  
  705.      WPCONV.BAT     @echo off
  706.                     rem
  707.      (using the     rem WPCONV.BAT
  708.      %WHAT%         rem
  709.      variable)      rem Automate conversion using WHAT?format!
  710.                     rem
  711.                     rem Change to a directory containing
  712.                     rem assorted WordPerfect files and give
  713.                     rem the command:
  714.                     rem
  715.                     rem    for %f in (*.*) do wpconv %f
  716.                     rem
  717.                     rem The files are converted to DCA format
  718.                     rem using the correct version of WP's
  719.                     rem CONVERT.EXE.
  720.                     rem
  721.                     if not exist %1 goto :end
  722.                     set what=what
  723.                     what %1
  724.                     if errorlevel 33 goto :notwp
  725.                     if errorlevel 32 goto :wp
  726.                     if errorlevel 1 goto :notwp
  727.                     goto :end
  728.                     :wp
  729.                     if "%what%"=="WordPerfect 5.1" goto :wp51
  730.                     if "%what%"=="WordPerfect 5.0" goto :wp50
  731.                     if "%what%"=="WordPerfect 4.x" goto :wp4x
  732.                     echo New version: %what%
  733.                     goto :end
  734.                     :wp51
  735.                     convwp51 %1 d:\DCAstuff\%1 1 1 std.crs
  736.                     goto :end
  737.                     :wp50
  738.                     convwp50 %1 d:\DCAstuff\%1 1 1
  739.                     goto :end
  740.                     :wp4x
  741.                     convwp42 %1 d:\DCAstuff\%1 1 1
  742.                     goto :end
  743.                     :notwp
  744.                     echo File is not WordPerfect format!
  745.                     :end
  746.                     set what=
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.      WHATDOC 30.0                                                       13
  763.  
  764.